﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Allocatin_DrawPrint : ATPages
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (!string.IsNullOrEmpty(Request.QueryString["id"]))
            {
                ZSql zsql = new ZSql();
                string sql = "select *,convert(char(10),alloDate,120) as adate,allowarehouse=(select warehousename from CS_Warehouse where warehouseid=a.alloware),recewarehouse=(select warehousename from CS_Warehouse where warehouseid=a.receware ) from CS_alloction a  where alloCode='" + Request.QueryString["id"].ToString() + "'";
                zsql.Open(sql);
                DataTable dt = new DataTable();
                string strTable = "";
                dt = zsql.m_table;
                if (dt != null)
                {
                    if (dt.Rows.Count > 0)
                    {
                        strTable += " <div style=\"width: 97%; font-size: 24px; font-weight: bolder; margin-bottom: 7px;\" align=\"center\">商品调拨单</div><table style=\"width: 100%\"><tr> <td colspan=\"2\" style=\"text-align: left\"></td><td width=\"15%\" style=\"text-align: left\"></td><td width=\"24%\" style=\"text-align: left\"></td></tr></tr><td width=\"36%\" style=\"text-align: left\">&nbsp;</td><td width=\"25%\" style=\"text-align: left\">&nbsp;</td><td style=\"text-align: left\"></td><td style=\"text-align: left\">&nbsp;</td></tr><tr><td style=\"text-align: left; height: 17px;\"><span style=\"text-align: left\">单号：" + Request.QueryString["id"].ToString() + "</span></td><td style=\"text-align: left; height: 17px;\">&nbsp;</td><td style=\"text-align: left; height: 17px;\"></td><td style=\"height: 17px; text-align: left\">&nbsp;</td> </tr></table>";

                        strTable += " <table align=\"right\" class=\"normal\" style=\"width: 97%\"><tr><td width=\"6%\" rowspan=\"6\"><p>商品</p><p>信息</p></td><td style=\"text-align:right\" >调出仓库：</td><td>" + zsql.m_table.Rows[0]["allowarehouse"].ToString() + "</td><td style=\"text-align:right\" >收货仓库：</td><td>" + zsql.m_table.Rows[0]["recewarehouse"].ToString() + "</td></tr><tr><td style=\"text-align:right\" >商品编号：</td><td width=\"31%\">" + zsql.m_table.Rows[0]["comodid"].ToString() + "</td><td width=\"16%\" style=\"text-align:right\" >条码：</td><td>" + zsql.m_table.Rows[0]["comodBarcode"].ToString() + "</td></tr><tr><td style=\"text-align:right\" >品&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; 牌 ： </td><td>" + zsql.m_table.Rows[0]["brand"].ToString() + "</td><td style=\"text-align:right\" >型号：</td><td>" + zsql.m_table.Rows[0]["modul"].ToString() + "</td></tr>";

                        strTable += " <tr><td style=\"text-align:right\" >商品名称：</td><td>" + zsql.m_table.Rows[0]["comodName"].ToString() + "</td><td style=\"text-align:right\" >单位：</td><td>" + zsql.m_table.Rows[0]["Unit"].ToString() + "</td></tr><tr><td style=\"text-align:right\" >调拨数量：</td><td>" + zsql.m_table.Rows[0]["number"].ToString() + "</td><td style=\"text-align:right\" >单价：</td><td>" + zsql.m_table.Rows[0]["Prices"].ToString() + "</td></tr><tr><td style=\"text-align:right\" >调拨日期：</td><td>" + zsql.m_table.Rows[0]["adate"].ToString() + "</td><td>&nbsp;</td><td></td></tr>";

                        strTable += "<tr><td colspan=\"2\"><p align=\"center\">主 管</p><p align=\"center\">签 字</p></td><td colspan=\"3\"></td></tr><tr><td colspan=\"2\"><div align=\"center\"><br /> 备 注<br /><br /></div></td> <td colspan=\"3\"></td></tr><tr><td colspan=\"4\"></td><td width=\"30%\">调拨人：" + zsql.m_table.Rows[0]["alloMan"].ToString() + "</td></tr></table>";

                      


                    }
                }
                zsql.Close();
                lblTable.Text = strTable;
            }
        }
    }
}
